Downhole NMR processing

ABSTRACT

An expert system is included in a downhole processor designed to acquire and process NMR data downhole in real time. The downhole processor controls the acquisition of the NMR data based at least in part on instructions transmitted downhole from a surface location and at least in part on evaluation of downhole conditions by the expert system. The downhole conditions include drilling operation conditions (including motion sensors) as well as lithology and fluid content of the formation obtained from other MWD data. The wait time, number of echos, number of repetitions of an echo sequence, interecho time, bandwidth and shape of the tipping and refocusing pulses may be dynamically changed. Data processing is a combination of standard evaluation techniques. Selected data and diagnostics are transmitted uphole. The expert system may be implemented as a two stage neural net. The first stage does the formation evaluation and the second stage controls the NMR pulse sequence.

CROSS REFERENCES TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.09/928,768 filed on Aug. 13, 2001, now U.S. Pat. No. 6,727,696.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention is related to methods for acquiring and processingnuclear magnetic resonance (NMR) measurements for determination oflongitudinal and transverse relaxation times T₁, and T₂. Specifically,the invention deals with use of an expert system downhole for acquiringand evaluating NMR measurements contemporaneous with the drilling ofwells and with use of a downlink communication from the surface formodifying the parameters of the downhole acquisition system.

2. Description of the Related Art

Nuclear magnetic resonance is used in the oil industry, among others,and particularly in certain oil well logging tools. NMR instruments maybe used for determining, among other things, the fractional volume ofpore space and the fractional volume of mobile fluid filling the porespace of earth formations. Methods of using NMR measurements fordetermining the fractional volume of pore space and the fractionalvolume of mobile fluids are described, for example, in “Spin EchoMagnetic Resonance Logging: Porosity and Free Fluid IndexDetermination,” M. N. Miller et al., Society of Petroleum Engineerspaper no. 20561, Richardson, Tex., 1990. Further description is providedin U.S. Pat. No. 5,585,720, of Carl M. Edwards, issued Dec. 17, 1996 andhaving the same assignee as the present application, entitled “SignalProcessing Method For Multiexponentially Decaying Signals AndApplications To Nuclear Magnetic Resonance Well Logging Tools.” Thedisclosure of that patent is incorporated herein by reference.

Deriving accurate transverse relaxation time T₂ relaxation spectra fromnuclear magnetic resonance (NMR) data from logging subterraneanformations, or from cores from such formations, is critical todetermining total and effective porosities, irreducible watersaturations, and permeabilities of the formations. U.S. Pat. No.6,069,477 to Chen et al having the same assignee as the presentapplication discusses the constituents of a fluid saturated rock andvarious porosities of interest. Referring to FIG. 1, the solid portionof the rock is made up of two components, the rock matrix and dry clay.The total porosity as measured by a density logging tool is thedifference between the total volume and the solid portion. The totalporosity includes clay-bound water, capillary bound water, movable waterand hydrocarbons. The effective porosity, a quantity of interest toproduction engineers is the sum of the last three components and doesnot include the clay bound water. Accurate spectra are also essential toestimate T₂ cutoff values and to obtain coefficients for the film modelor Spectral Bulk Volume Irreducible (SBVI) model. Effective porositiesare typically summations of partial porosities; however, distortion ofpartial porosity distributions has been commonly observed for a varietyof reasons. These reasons include poor signal-to-noise ratio (SNR), andpoor resolution in the time domain of the NMR data.

The most common NMR log acquisition and core measurement method employsT₂ measurements using CPMG (Carr, Purcell, Meiboom and Gill) sequence,as taught by Meiboom and Gill in “Modified Spin-Echo Method forMeasuring Nuclear Relaxation Time,” Rev. Sci. Instrum. 1958, 29, pp.688–691. In this method, the echo data in any given echo train arecollected at a fixed time interval, the interecho time (TE). Usually, afew hundred to a few thousand echoes are acquired to sample relaxationdecay. However, for determination of CBW, echo sequences of as few asten have been used.

There are numerous examples of wireline NMR logging tools used forobtaining information about earth formations and fluids after a wellborehas been drilled. The logging tools are lowered into the borehole andNMR signals are obtained using different configurations of magnets,transmitter coils and receiver coils. Rig time is expensive, so that thegeneral objective in wireline logging is to obtain interpretable datawithin as short a time as possible. Depending upon the reservoir,different radio frequency (RF) pulsing schemes for generating RF fieldsin the formation have been used. The most commonly used pulsing schemesare variations of the CPMG sequence. The parameters that may be variedare the wait time, the number of pulses within a CPMG sequence, and thetime interval between the pulses. Long wait times are needed for properevaluation of the long relaxation times of gas reservoirs while shortwait times and/or short pulse spacings are used for evaluating claybound water (CBW). For example, co-pending U.S. patent application Ser.No. 09/396,286 (now U.S. Pat. No. 6,331,775) of Thern et al, having thesame assignee as the present application and the contents of which arefully incorporated herein by reference, discusses the use of a dual waittime acquisition for determination of gas saturation in a formation.U.S. Pat. No. 5,023,551 to Kleinberg et al discusses the use of CPMGsequences in well logging. U.S. Pat. No. 6,069,477 to Chen et al, thecontents of which are fully incorporated herein by reference, teachesthe use of pulse sequences with different pulse spacings to determineCBW. Phase alternated pairs (PAPs) of sequences are commonly acquired toreduce the effects of ringing.

Tool vibration is usually not a problem in wireline logging, so thatdata may be acquired using continuous pulsing while the logging tool isbeing pulled up the borehole. In many instances, other logs may alreadyhave been run before the NMR measurements are made, so that somepreliminary evaluation of the subsurface formations may already exist.This makes it possible to use predefined pulse sequences optimized forspecific evaluation objectives.

The commonly used seven conductor wireline is not a serious limitationto two-way communication from the surface to the logging tool. Thismakes it possible to process data uphole with little or no downholeprocessing and to send instructions downhole to the logging tool tomodify the acquisition scheme based on the surface processing.

In contrast, measurements made with a drilling assembly in the wellborehave several problems. First of all, there is little prior informationavailable about the actual subsurface formations except that inferredfrom surface seismic data. As would be known to those versed in the art,the resolution of such seismic data is of the order of several meters totens of meters. This makes it difficult, if not impossible, to base anacquisition scheme on the basis of expected properties of formations.

Secondly, when the drilling assembly is in a borehole, datacommunication capability is in most cases severely limited. Telemetry isaccomplished either by sending acoustic pulses through the mud orthrough the drillstring. The data rate with mud pulsing is limited to afew bits per second and communication through the drillstring becomes aserious problem when the drillbit is being operated due to the vibrationand noise produced. This makes it impossible to evaluate acquired dataat the surface and to modify the acquisition scheme based on thisevaluation.

A third problem arises from the nature of NMR data itself. The sensitivevolume of commonly used logging tools is no more than a few millimetersin thickness. The RF frequency is tuned to operate at the Larmorfrequency corresponding to the static magnetic field in the sensitivevolume, so that any transversal motion of the tool during drilling willmean that the RF pulses have a frequency corresponding to a region thathas not been pre-polarized by the static magnetic field. This results ina severe degradation of the data. U.S. Pat. No. 5,705,927 issued toKleinberg discloses making the length of each CPMG sequence small, e.g.10 ms, so that the drill collar cannot be displaced by a significantfraction of the vertical or radial extent of the sensitive region duringa CPMG pulse sequence. However using such short sequences and short waittimes only gives an indication of the bound fluid volume and gives noindication of the total fluid volume.

There is a need for an apparatus and method of obtaining NMRmeasurements while a wellbore is being drilled that is able to modifythe acquisition parameters with a minimum of communication with thesurface. Such an invention should preferably be able to adjust theacquisition depending upon actual downhole conditions. The method shouldpreferably be robust in the presence of vibration of the logging tool.The present method satisfies this need.

SUMMARY OF THE INVENTION

The present invention is an apparatus and method for acquiring NMR dataof an earth formation using a sensor assembly conveyed on a measurementwhile drilling device in a borehole in the earth formation. The sensorassembly includes components on a non-rotating sleeve that may beclamped to the formation. With this arrangement, it is possible tocontinue drilling operations (“making hole”) while making NMR pulse echomeasurements at a fixed depth in the borehole and substantially isolatedfrom vibrations caused by drilling. A downhole processor controls theacquisition and processing of the data. The processor controls theacquisition parameters based upon downhole motion sensors and also basedupon control signals sent from the surface. Motion sensors such asaccelerometers are used to monitor the motion of the sensor assembly andQuality control diagnostics are generated in real time. The processingincludes standard processing methods. The basic pulse sequence is a CPMGsequence, although modified CPMG sequences with reduced powerconsumption may be employed.

An expert system in the downhole processor also determines the lithologyand fluid content of formations being drilled based on signals fromother formation evaluation sensors such as gamma ray, neutron,resistivity and acoustic sensors. Information from a formation pressuretester (FPT) may also be used. The FPT provides measurements offormation pressure, mobility and compressibility of the fluid. Basedupon this evaluation of the formation lithology and fluid content, theexpert system may control the NMR acquisition parameters independentlyof surface control.

Under the control of the downhole processor, measurements may be made inone of several modes. These include measurements while the NMR sensorassembly is clamped, measurements made when the NMR sensor assembly isrotating, measurements made when connecting (adding or removing drillsegments at the surface) and measurements made while tripping (pullingthe drillstring out of the borehole).

The parameters of the pulse sequence that may be controlled include thewait time, the number of echos in a phase alternated pulse sequence, thenumber of repetitions of the phase alternated sequence, the tippingangle of the refocusing pulses, and the interecho spacing. Motiontriggered pulsing may be used. In addition, the shape and bandwidth ofthe refocusing pulses may also be changed dynamically.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 (prior art) shows the different constituents of a fluid filledrock.

FIG. 2 (prior art) shows the arrangement of a measurement-while-drillingsystem in accordance with the present invention.

FIG. 3 (prior art) shows a cross section of a drilling assemblyincluding a sensor assembly in accordance with the present invention;

FIG. 4 shows the use of a thruster assembly below the drill pipe sectionin the sensor assembly.

FIG. 5 is a flow chart illustrating the use of an expert system fordetermining lithology and controlling the NMR acquisition, and

FIG. 6 is a flow chart illustrating the training of a neural net.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 2 shows a schematic diagram of a drilling system 10 with adrillstring 20 carrying a drilling assembly 90 (also referred to as thebottom hole assembly, or “BHA”) conveyed in a “wellbore” or “borehole”26 for drilling the wellbore. The drilling system 10 includes aconventional derrick 11 erected on a floor 12 which supports a rotarytable 14 that is rotated by a prime mover such as an electric motor (notshown) at a desired rotational speed. The drillstring 20 includes atubing such as a drill pipe 22 or a coiled-tubing extending downwardfrom the surface into the borehole 26. The drillstring 20 is pushed intothe wellbore 26 when a drill pipe 22 is used as the tubing. Forcoiled-tubing applications, a tubing injector, such as an injector (notshown), however, is used to move the tubing from a source thereof, suchas a reel (not shown), to the wellbore 26. The drill bit 50 attached tothe end of the drillstring breaks up the geological formations when itis rotated to drill the borehole 26. If a drill pipe22 is used, thedrillstring 20 is coupled to a drawworks 30 via a Kelly joint 21,swivel, 28 and line 29 through a pulley 23. During drilling operations,the drawworks 30 is operated to control the weight on bit, which is animportant parameter that affects the rate of penetration. The operationof the drawworks is well known in the art and is thus not described indetail herein.

During drilling operations, a suitable drilling fluid 31 from a mud pit(source) 32 is circulated under pressure through a channel in thedrillstring 20 by a mud pump 34. The drilling fluid passes from the mudpump 34 into the drillstring 20 via a desurger (not shown), fluid line28 and Kelly joint 21. The drilling fluid 31 is discharged at theborehole bottom 51 through an opening in the drill bit 50. The drillingfluid 31 circulates uphole through the annular space 27 between thedrillstring 20 and the borehole 26 and returns to the mud pit 32 via areturn line 35. The drilling fluid acts to lubricate the drill bit 50and to carry borehole cutting or chips away from the drill bit 50. Asensor S₁ preferably placed in the line 38 provides information aboutthe fluid flow rate. A surface torque sensor S₂ and a sensor S₃associated with the drillstring 20 respectively provide informationabout the torque and rotational speed of the drillstring. Additionally,a sensor (not shown) associated with line 29 is used to provide the hookload of the drillstring 20.

In one embodiment of the invention, the drill bit 50 is rotated by onlyrotating the drill pipe 22. In another embodiment of the invention, adownhole motor 55 (mud motor) is disposed in the drilling assembly 90 torotate the drill bit 50 and the drill pipe 22 is rotated usually tosupplement the rotational power, if required, and to effect changes inthe drilling direction.

In the preferred embodiment of FIG. 2, the mud motor 55 is coupled tothe drill bit 50 via a drive shaft (not shown) disposed in a bearingassembly 57. The mud motor rotates the drill bit 50 when the drillingfluid 31 passes through the mud motor 55 under pressure. The bearingassembly 57 supports the radial and axial forces of the drill bit. Astabilizer 58 coupled to the bearing assembly 57 acts as a centralizerfor the lowermost portion of the mud motor assembly.

In one embodiment of the invention, a drilling sensor module 59 isplaced near the drill bit 50. The drilling sensor module containssensors, circuitry and processing software and algorithms relating tothe dynamic drilling parameters. Such parameters preferably include bitbounce, stick-slip of the drilling assembly, backward rotation, torque,shocks, borehole and annulus pressure, acceleration measurements andother measurements of the drill bit condition. A suitable telemetry orcommunication sub 72 using, for example, two-way telemetry, is alsoprovided as illustrated in the drilling assembly 90. The drilling sensormodule processes the sensor information and transmits it to the surfacecontrol unit 40 via the telemetry system 72.

The communication sub 72, a power unit 78 and an MWD tool 79 are allconnected in tandem with the drillstring 20. Flex subs, for example, areused in connecting the MWD tool 79 in the drilling assembly 90. Suchsubs and tools form the bottom hole drilling assembly 90 between thedrillstring 20 and the drill bit 50. The drilling assembly 90 makesvarious measurements including the pulsed nuclear magnetic resonancemeasurements while the borehole 26 is being drilled. The communicationsub 72 obtains the signals and measurements and transfers the signals,using two-way telemetry, for example, to be processed on the surface.Alternatively, the signals can be processed using a downhole processorin the drilling assembly 90.

The surface control unit or processor 40 also receives signals fromother downhole sensors and devices and signals from sensors S₁–S₃ andother sensors used in the system 10 and processes such signals accordingto programmed instructions provided to the surface control unit 40. Thesurface control unit 40 displays desired drilling parameters and otherinformation on a display/monitor 42 utilized by an operator to controlthe drilling operations. The surface control unit 40 preferably includesa computer or a microprocessor-based processing system, memory forstoring programs or models and data, a recorder for recording data, andother peripherals. The control unit 40 is preferably adapted to activatealarms 44 when certain unsafe or undesirable operating conditions occur.

A suitable NMR device for use in the present invention is disclosed inU.S. Pat. No. 6,247,542 to Kruspe et al, the contents of which are fullyincorporated herein by reference. This is show in FIG. 3. A segment 70of drill pipe 22, illustrated in greater illustrates the apparatus andmethod according to Kruspe including a sleeve member, such as a sensorassembly, slidably coupled to a longitudinal member, such as a sectionof drill pipe, wherein, when the sleeve member is non-rotating, thelongitudinal member is free to rotate. The sleeve member may be held ina non-rotating position through engagement with the borehole wall and adecoupling of the sleeve member and the rotating drillstring. However,the apparatus and method according to the present invention can beadapted for any MWD device or tool typically used on a rotatingdrillstring.

The MWD tool 79, including an associated pulsed NMR tool 77 having asensor assembly 113, and the pulsed power unit 78 are connected intandem in the drilling assembly 90. The MWD tool 79 may also include asonic sensor, a density measurement tool, and a porosity measurementtool. As seen in FIG. 3, the NMR tool 77 is rotationally symmetric abouta longitudinal axis 128 of the drilling assembly 90. The longitudinalmember is, for example, a drill pipe section 101, which forms the coreof the segment 70. Alternatively, the longitudinal member is a shaft ina downhole directional drilling assembly. The drill pipe section 101 isconnected to the drillstring 20 by the upper tool joint 103 and thelower tool joint 139, and has a channel or flow pass 105 for thedrilling mud to flow downhole. The sensor assembly 113 surrounds thedrill pipe section 101 and is slidably coupled to the longitudinalmember or the drill pipe section 101. The sensor assembly 113 is coupledto the drill pipe section 101 by at least one of guide sleeves 109 and111. The guide sleeves 109 and 111 include, for instance, slip rings andbearings 110 and 112, respectively. Alternatively, a single guide sleeve(not shown) including slip rings and bearings, is used, for example,centrally located between ends of the sensor assembly 113. The guidesleeves 109 and 111 allow the sensor assembly 113 to move freely in theaxial direction and to a lesser extent laterally with respect to thedrill pipe section 101. The sensor assembly 113 has an outer diameterthat is somewhat less than the inner diameter of the borehole 26. Forillustrative purposes, FIG. 3 shows the space between the sensorassembly 113 and the borehole wall in an exaggerated manner. The NMRsensor assembly includes flow paths 107 and 114 for return flow of thedrilling mud from the drilling assembly 90 below wherein the gap betweenthe sensor assembly 113 and the borehole wall are minimized.

The magnet assembly 115, for providing the static magnetic field, andthe RF coil assembly 117 are disposed in the sensor assembly 113. The RFcoil assembly 117 includes, for instance, at least one transmitter fortransmitting a pulsed RF field into the formation. In the configurationas illustrated in FIG. 3, the RF field is axial and is orthogonal to thestatic field of the permanent magnet assembly 115 in a region ofinterest or examination outside the borehole for NMR signalmeasurements. However, the apparatus of the present invention is notlimited to the illustrated sensor assembly 113. Any number ofappropriate magnet arrangements and antenna or coil arrangements whichprovide a static magnetic field and an RF field orthogonal to the staticmagnetic field direction for creating the region of interest for NMRsignal sensitivity can be used according to the present invention. Forexample, the NMR tool 77 can employ separate transmitter and receiver RFcoils, located, for example, on the sensor assembly 113.

Typically, the RF coil assembly 117 is pulsed and creates a highfrequency electromagnetic RF field orthogonal to the static magneticfield generated by the magnet assembly 115 and in the region ofsubstantially uniform field strength creating the region or volume ofinterest for NMR signal sensitivity. The sensor assembly 113 detects theNMR signals resulting therefrom. Rock pores in the earth formationssurrounding the wellbore are filled with fluid, typically water orhydrocarbon. The hydrogen nuclei in the fluid are aligned by the regionof homogeneous magnetic field, generated by the magnet assembly 115. Thehydrogen nuclei are then flipped away from the homogeneous magneticfield by the pulsed RF field produced by RF coil assembly 117. At thetermination of the pulsed RF field from RF coil assembly 117, thehydrogen nuclei revolve or precess at high frequency around thehomogeneous magnetic field inducing an NMR signal in the RF coilassembly 117 until the hydrogen nuclei relax to the original directionalong the homogeneous magnetic field. The induced NMR signals areprocessed downhole or sent to the surface for processing.

Those versed in the art would recognize that, depending upon theconfiguration of the permanent magnet assembly 115, the region ofexamination could have one of a number of configurations. In oneembodiment, the region of examination could be substantially toroidalshaped with the axis of the toroid along the longitudinal axis of thetool. In other configurations, the region of examination could belocalized on opposite sides of the borehole or even on just one side ofthe borehole. It will also be clearly apparent to those skilled in theart that the static magnetic field area can also be obtained if themagnet assembly 115 includes de-energized electromagnets, orsuperconducting dc electromagnets. All of these are intended to bewithin the scope of the present invention.

The NMR electronics 129 is housed in the NMR sensor assembly 113. Thepurpose of the NMR electronics 129 is to control the sensor assembly113, record, process and transmit the recorded data, to the telemetrymodule 72. This can be done by means of electrical or acoustic telemetryby known devices and will not be discussed. A spring 130 having a cableconduit through the spring 130 allows power and data transmission viathe guide sleeve 111 and slip ring through the cable conduit to and fromthe MWD tool 79. The MWD tool 79 also transmits data to the sensorassembly 113, for example, through mud pulse telemetry, and providespower from the power unit 78. The NMR electronics may also be referredto hereafter as a downhole processor, though it is to be understood thata downhole processor may be located at other positions in the downholeassembly.

The sensor assembly 113 is also provided with at least one clamping pad,clamping piston or ribs 121. The ribs 121 are capable of outwardmovement for locking the sensor assembly 113 to the borehole wall duringmeasurement by the sensor assembly 113. In one embodiment, the ribs 121are hydraulically activated. In the inactivated position of the ribs121, the sensor assembly 113 rests on the lower tool joint 139 and isheld up against gravitational pull by the spring 130 that is fixedlyattached to the drill pipe section 101. Continued rotation of thedrillstring 20 loosely carries the sensor assembly 113 along. In theactivated position, the ribs 121 engage the borehole walls and preventany further movement of the sensor assembly 113. Further rotation of thedrillstring 20 does not affect the position of the sensor assembly 113that remains in a clamped position against the borehole wall. In theclamped position, the sensor assembly 113 is essentially decoupled fromrotational and vertical movement of the drillstring 20, enablingmeasurements, such as NMR measurements from the NMR sensor assembly 113,to be carried out without interference from tool motion and vibration.Due to the proximity of the borehole wall to the magnet assembly 115,the region of examination is within the formation and any signal fromthe borehole fluid is small. In typical operation, the NMR measurementtakes between 0.01 to 1 second, during which time the drill pipe section101 advances some distance. Once the NMR measurement has been completed,the ribs 121 are retracted, as a result of which the sensor assembly 113is no longer coupled to the borehole wall. The sensor assembly 113 thendrops down until any further downward motion is stopped by the spring130. In another embodiment, the ribs 121 are actuated electrically,e.g., by a stepper motor. Other methods, such as those using springs,would be known to those versed in the art.

The device of Kruspe thus comprises a sensor assembly mounted on aslidable sleeve slidably coupled to a longitudinal member, such as asection of drill pipe. When the sensor assembly is held in a nonrotating position, for instance for obtaining the measurements, thelongitudinal member is free to rotate and continue drilling theborehole, wherein downhole measurements can be obtained withsubstantially no sensor movement or vibration. This is particularlyuseful in making NMR measurements due to their susceptibility to errorsdue caused by tool vibration. A clamping device is used, for instance,to hold the sensor assembly is held in the non rotating position. Alsodisclosed in Kruspe but not shown in FIG. 3 is the use of one or morethrusters for axial decoupling of the sensor assembly from thedrillstring. FIG. 4 illustrates the use of a thruster 350 below thedrill pipe section with the sensor assembly 113.

The specific NMR sensor discloses in Kruspe et al has permanent magnetsas well as RF antennas on the sleeve. A suitable sensor configuration isdisclosed in U.S. Pat. No. 6,215,304 to Slade, the contents of which arefully incorporated herein by reference. The tool is rotationallysymmetric, i.e., it measures 360° around the tool simultaneously.However, as noted in the Kruspe patent, other magnet and antennaconfigurations could be used. An advantage of using the Slade device isthat usually no borehole correction is necessary because the tool istuned to read only formation signal unless the hole is severely enlargedor the tool is off center.

A thruster allows compensation for the axial drillstring movement duringthe acquisition. This is provides the tool with a great deal offlexibility in acquisition of NMR data. Specifically, four modes ofoperation are possible with the tool:

-   -   1. Measurement while the drillbit is actively engaged in making        hole with the NMR sensor clamped to the formation;    -   2. Measurement while the drillbit is actively engaged in making        hole with the NMR sensor rotating and moving downhole;    -   3. Measurement while connecting; and    -   4. Measurement while tripping.        For convenience, the first mode is referred to as the clamped        mode, the second as the rotating mode, the third as the        connecting mode and the fourth as the tripping mode. It should        also be noted that there are other devices besides drillbits        that could be used for “making hole”, i.e., actively penetrating        the formation. An example of this is the use of cutting jets        that “make hole” by the use a fluid at high pressure injected        through a nozzle. The term “making hole” as used hereafter is        intended to cover the use of drillbits, cutting jets and other        similar devices. The four modes of operation are now discussed        briefly.

In the clamped mode of operation, the sensor assembly is clamped to theborehole and is thus substantially decoupled from motion of the drillbitand vibration of the bottom hole assembly. Depending upon the rate ofpenetration (ROP), data acquisition in the clamped mode may be carriedout for several minutes. This makes it possible to acquire data withlong pulse sequences with enhanced signal to noise ratio (SNR).

In the rotating mode, the sensor assembly is rotating at a rate thatcould be almost as rapid as the rotation of the drilling tubular. Therotation by itself does not degrade the quality of data acquired by thesensor assembly due to the complete rotational symmetry of the region ofexamination of the tool. However, due to tool vibration (transverse andvertical) and whirl, data quality may be degraded. This arises from thefact that the region of examination is relatively small so that pulseecho signals may arise from regions of the formation that are onlypartially polarized by the permanent magnets.

To deal with the problems caused by tool motion in the rotating mode,one embodiment of the present invention uses the teachings of co-pendingU.S. patent application Ser. No. 09/778,205 of Hawkes et al, thecontents of which are incorporated herein by reference. Hawkes et alteach the use of motion triggered pulsing for NMR measurements. Themotion of the tool is measured by suitable motion sensors, such asaccelerometers, magnetometers or gyroscopes or combinations thereofThese sensors may be placed at any suitable location on the drillingtool in the proximity of the magnet and coil arrangement. The waitperiod in a pulse sequence may be extended slightly without affectingthe data quality and this feature may be used to delay the applicationof the tipping pulse until a suitable state of tool motion is achieved.The trigger may be obtained by monitoring the motion sensor signals.Suitable states for triggering are instantaneous moments when the toolis stationary, or if the motion has a strong periodic component, thensubsequent pulse sequences may be triggered to synchronize with thismotion. Such motion triggered pulsing will improve the NMR spin-echoformation. Hawkes also teaches the use of predictive filtering, such asKalman filtering, for initiating the tipping pulse that is commonly usedin a CPMG pulse sequence. This too may be used in the method of thepresent invention.

As would be recognized by those versed in the art, the length of thepulse sequences used in analysis of the formation would be controlled atleast in part by the ROP. At low ROP, it is possible to use long pulsesequences to improve the SNR without loss of resolution. As always, theavailable power is a limitation and an optional embodiment of thepresent invention may use the modified CPMG sequence taught in U.S. Pat.No. 6,163,153 by Reiderman et al with a shortened refocusing pulse.

In the changing mode, the drillbit is non-rotating and the drillstringis clamped at the surface while additional sections of drill pipe areadded or removed. However, due to the elasticity of the drillstring,vertical and transverse vibrations continue. The total acquisition timeis usually limited to less than sixty seconds. Again, the motiontriggered pulsing scheme of Hawkes et al may be used, and with betterresults than in the rotating mode. The improvement arises from the factthat the entire drillstring may be vibrating freely without additionalstresses and whirl caused as the drillbit “makes hole.”

In the tripping mode, the axial tool motion is quite rapid. Typically,three sections of drillstring (a total of 90 ft.) are pulled at a time,after which the drillstring is clamped at the surface (at which timeacquisition in the changing mode is possible). Due to the rapid toolmovement and the small aperture of the NMR tool, correction has to bemade for the change in the sensitive volume during a pulse sequence. Inone embodiment of the invention, this is a simple geometric correctionfactor based upon the nominal velocity of tool motion as measured at thesurface. In an alternate embodiment of the invention, accelerometers onor near the NMR sensor make measurements of the axial acceleration ofthe NMR sensor. The actual velocity of tool motion is determined fromthe accelerometer measurements and used to derive the correction factor.

Regardless of the mode of operation, data are acquired and processedusing one of two schemes. The standard data acquisition and processingscheme uses methods that have been used in wireline logging. Theacquisition and processing parameters for this are stored in the memoryof the downhole processor and are described below. In addition to thestandard acquisition and processing scheme, the downhole processor alsoincludes an expert system that analyzes data acquired by the NMR sensorassembly and one or more additional sensors, including formation sensorsand sensors indicative of drilling conditions as discussed above. Theexpert system, as described below, modifies the acquisition andprocessing schemes used for the NMR data. This may be done independentlyof the surface processor 40 or may be done in response to downlinkcommands from the surface processor 40 through the communication sub 72.Such a downlink telemetry system is taught in European Patent 744,527 ofOppelt et al and U.S. Pat. No. 5,963,138 of Gruenhagen et al, having thesame assignee as the present application.

Standard Acquisition and Processing

The acquisition and processing steps are discussed in conjunction. Onepre-processing step that is routinely carried out is replacement ofinvalid data. Based on Quality Control (QC) diagnostics that indicatethe tool performance, invalid data are recognized and (if possible)replaced by valid data. Recognition of invalid data is based on adequatediagnostics. These diagnostics are provided by the motion sensorsdiscussed in the Hawkes application. Even in the clamped mode ofacquisition, it is preferable to do the clamping at a time when themotion of the drill collar is small. While this is not a guarantee thatgood data will be acquired when clamped, it does provide some insurance.When data are acquired in the rotating mode, motion triggered pulsing ishighly desirable. However, analysis of the data after acquisition maystill require that all data of one acquisition cycle be discarded. Forthis purpose, diagnostics data have to be acquired and evaluatedparallel to the NMR acquisition (e.g., hardware performance, vibrationdata). If these data are not available, the data quality can beindicated with real-time analysis of the sum of echos (SE) as discussedbelow.

If the motion sensors indicate that the entire cycle of measurementsmade in the clamped mode is defective due to excessive motion, then nocorrection of the data is possible. If, however, excessive motion occurswith a single echo train out of a plurality of echo trains made at aclamped position, then that echo train is replaced by a previouslyacquired echo train of the same phase and channel. The term “phase” hererefers to phase alternated pulse sequences in the data acquisition asused in the art. The term “channel” refers to the fact that NMR echosignals are acquired in two channels that are in-phase and in quadratureto the RF carrier phase.

As another part of the preprocessing, if portions of echo trains areacquired when the diagnostics indicate excessive vibration, then thesepartial echo trains are replaced with null values. Subsequent processingrecognizes these null values and accounts for them in the processing.Finally, if isolated points of the echo sequence are invalid, then theseisolated points are replaced with a weighted or unweighted average ofsurrounding echo (point) data.

Another aspect of the present standard preprocessing in the presentinvention is that based on the echo shape and the overlying noise (whitenoise plus non-random ringing) several methods can be used for echopoint averaging with different purposes. One simple method to averageecho points is linear averaging of the data in the whole acquired echowindow. An alternate embodiment of the invention uses weighted averagingof the data, where the weighting is fixed (e.g., cosine function) ordetermined in lab and field experiments (e.g., expected shape of theecho signal to maximize signal-to-noise ratio). These windows arecentered on a peak value of the measured echo signal and provide somediscrimination against random noise.

Another preprocessing step in the invention uses sums of individual echotrains as a quality control (QC) indicator. U.S. patent application Ser.No. 09/483,336 to Chen discusses the use of summed echo trains as a QCindicator and is incorporated herein by reference. In the presentinvention, sums of individual echo trains at a clamped depth are used todetermine the quality of the data.

The standard preprocessing preferably includes the so-called phasealternated pulse (PAP) sequence. Successive CPMG or modified CPMGsequences are acquired with alternating phases of the tipping pulse.Depending on the sign convention used, the −90°_(x) and +90°_(x) dataare either subtracted or added to eliminate constant offset of the echochannel data. If different echo train data are combined (also for phaseand amplitude calculation and stacking), a corrected acquisition timefor the combined data has to be calculated (e.g. for PAP data calculatemean acquisition time of the two echo trains) In an alternate embodimentof the invention, no PAP averaging is done. Such a method of dataacquisition and processing is taught in co-pending U.S. patentapplication Ser. No. 09/691,514 of Chen, having the same assignee as thepresent application and the contents of which are fully incorporatedherein by reference. As taught by Chen, phase alternation is done in theacquisition, but no averaging is done for pairs of phase alternateddata; instead,

The preprocessing also includes a correction for stimulated echoeffects. The stimulated echo effects arise from imperfect tipping andrefocusing pulses. Evan a small gradient field makes it impossible tocreate a perfect pulse that will rotate protons in the sample spaceexactly the desired angle (e.g. 180°) and not rotate protons “near” thesample space that are off resonance. The calibration of the tool in aknown environment allows these effects to be determined and correctionequations derived. As a result of the imperfect pulses, the first fewechoes do not fit the rest of the echoes and need to be scaled by acorrection factor. It is commonly observed that amplitude of the firstecho has to be increased, while the amplitude of later echos (such asthe second and third echos) needs to be decreased by the stimulated echocorrection. The correction for the first echo varies quadratically withB₁ and is computed from the current B₁ value. The correction for thesecond echo is independent of B₁. The correction equation is:EPA _(n,corr)=STE_(n)*EPA_(n)  (1)where EPA_(n) and EPA_(n,cor) are the uncorrected and corrected valuesof the n-th echo, and STE_(n) is the stimulated echo correction. In apreferred embodiment of the invention, STE_(n), is determined by lab orfield experiments or by simulation results. As would be known to thoseversed in the art, STE_(n) depends upon B₁ and the operatingtemperature. It may also depend upon the tipping and refocusing anglesand the bandwidth of the transmitter and receiver.

Included in the standard preprocessing is a determination of the phaseangle and noise level and correcting the measured amplitudes based onthe phase angle. The signals measured in the two channels E_(x) andE_(y) have amplitudes E_(xn) and E_(yn) respectively. The phase angle θis given by

$\begin{matrix}{{\theta = {\tan^{- 1}\left\lbrack \frac{\sum\limits_{n = 1}^{NE}\; E_{x\; n}}{\sum\limits_{n = 1}^{NE}\; E_{y\; n}} \right\rbrack}},} & (2)\end{matrix}$the echo amplitude E_(n) is given byE _(n) =E _(yn) cosθ+E _(xn) sinθ  (3),the noise N_(n) is given by:N _(n) =E _(xn) cosη−E _(yn) sinθ  (4)and the noise level σ_(N) is given by:

$\begin{matrix}{\sigma = {\sqrt{\frac{\sum\limits_{n = 1}^{NE}\left( {N_{n} - {{mean}\mspace{11mu}(N)}} \right)^{2}}{{NE} - 1}}.}} & (5)\end{matrix}$

After the preprocessing steps are carried out, additional processing ofthe data is carried out for determination of petrophysical parameters ofthe formation. As part of the petrophysical processing, a calibration iscarried out. A calibration factor is used to convert measured echosignals to signal amplitudes in porosity units (p.u.). Measurements aretaken in an environment with known porosity and where a single decaycomponent of the fluid is expected. The calibration procedure includes:

-   -   1. Measuring the temperature Temp_(cal)    -   2. Measuring echo data in a medium of known porosity φ_(k). In a        preferred embodiment of the invention, this step comprises        making measurements in a calibration chamber filled with 100%        water (φ=1.0).    -   3. Deriving a best linear fit to the logarithm of the echo data.    -   4. Extrapolating the linear fit back to zero time to give a        value of the echo at zero time E₀.    -   5. Obtaining the calibration factor C as        C=φ _(k) /E ₀.  (6)        The derived calibration factor C is applied to the acquired echo        data.

Increasing salinity causes displacement of hydrogen atoms by salt ions.The salinity correction factor is multiplied to the echo data forcompensation. The petrophysical processing of the echo data typicallyincludes a correction for salinity. The salinity of the fluid in thetool's sensitive region can be approximated by the formation fluidsalinity or, in case of an invaded formation, by the salinity of the mudfiltrate. No salinity correction is necessary if the formation is mainlyoil filled or if the resistivity of the formation fluid >10 Ωm at 75° F.The salinity correction SC is given by:SC=NaCl/100,000*0.04+1  (7)

-   -   NaCl=salinity of the fluid in the NMR-sensitive volume [in ppm]

Another step in the petrophysical processing is the derivation of thesum of echos SE. SE provides QC information used as discussed above in[0031]. SE also provides petrophysical information such as a highresolution permeability estimation. Such a method is disclosed inSezinger et al., “High Resolution Permeability Indicator” presented atthe 1999, SPWLA Annual Conferences and Exhibition, Oslo, Norway, June1999.

Stacking of the data may be performed to increase SNR. In the clampedmode, this includes averaging of all data from one clamping cycle. Inthe connecting mode, this includes averaging of all data from oneresting cycle. In the tripping mode, this includes windowed averaging ofdata over a plurality NL levels. Typically, in the tripping mode, datafrom up to 4 levels are averaged.

The downhole processor includes a program that determines the porosityof the formation and the irreducible water saturation (BVI). Theacquired echo data are fitted by a multi-exponential decay plus anoptional constant term:

$\begin{matrix}{E_{n} = {\phi_{0} + {\sum\limits_{i = 1}^{K}\;{\phi_{i}{\mathbb{e}}^{{- n}\;{\Delta/T_{2\; i}}}}}}} & (8)\end{matrix}$where n is the echo index and Δ is the interecho spacing. In a preferredembodiment of the invention, two exponential terms are used (K=2). Insuch a case, the total porosity φ is given by

$\begin{matrix}{\phi = {\sum\limits_{i = 0}^{k}\;\phi_{i}}} & (9)\end{matrix}$The irreducible water saturation, BVI, is calculated by weightedcontributions of the partial porosities in reference to a given cutoffvalue, T_(2c). Porosity can also be measured by additional sensors (e.g.density, accoustic, neutron etc.) and can be compared with thosemeasurements on a realtime basis.

Another step in the petrophysical processing is the correction forformation temperature. The formation temperature affects the thermalrelaxation of the protons for T₁ and T₂ and reduces the amplitude of thereturned signal with decreasing temperature. The magnitude of theamplitude correction expressed as the Formation Temperature Multiplier,FTM, is proportional to the absolute temperature.FTM=(Temp_(f)+273.15)/(Temp_(ref)+273.15)  (10)where

-   -   Temp_(f)=Formation temperature in ° C.        and Temp_(ref)=Calibration reference temperature in ° C. This        equation is based on Curie's Law.

The increased temperature of the formation reduces the density of theformation fluid and decreases the hydrogen index. Higher pressureincreases the hydrogen index. The petrophysical processing includes acompensation for this change. The net difference is compensated for bythe Hydrogen Depletion Multiplier, HDM, which is a function of theapparent porosity and formation temperature.HDM=(φ_(a)/30)*((Temp_(f)−10)/194.44)*0.1)+1  (11)where φ_(a)=Apparent porosity from eq. (9), and Temp_(f)=Formationtemperature in ° C.

In a preferred embodiment of the invention, when standard processing isused, the downhole processor sends processed data to the surfaceprocessor using the telemetry sub 72. Due to the limited transmissioncapability of the telemetry channel, the data that are sent up arelimited. Typically, they include the total porosity φ, the BVI, the sumof echos SE, and the level σ_(N). Additional QC indicators that may besent include the signals indicative of the motion of the tool. This isin addition to other formation evaluation data that may be sent uphole.These may include processed or unprocessed data from gamma ray tools,neutron logging tools, density tools and resistivity tools. Such deviceswould be known to those versed in the art and are not discussed herefurther.

The operator at the surface has access to the data sent from thetelemetry sub 72 and they are processed and/or displayed by the surfacecontrol unit 40. Based upon this, the operator can evaluate the drillingconditions, make judgments about the lithology and formation fluid beingdrilled and evaluate the quality of the data (specifically including theNMR data). Based upon this evaluation, the operator may sendinstructions downhole that alter the acquisition parameters being usedfor the NMR data. This is done on a real-time basis in the drilling orclamping mode. It may also be done in the connecting mode and thetripping mode with less effectiveness. The reasons for the loweredeffectiveness of altering the acquisition parameters is that in thetripping mode, the bottom hole assembly generally has a fairly rapidmotion that may encompass several different lithologies and fluid types.The acquisition parameters that my be controlled are discussed next.

In a preferred embodiment of the invention, much of the NMR data areacquired using CPMG sequences or modified CPMG sequences as taught byReiderman et al. As would be known to those versed in the art, a CPMGsequence may be represented as:[TW_(i)−90_(±π/2)−(τ−X−τ−echo)_(j)]_(i)  (12)where TW is a wait time, 90_(±π/2) refers to a phase alternated 90°tipping pulse, X is a refocusing pulse with a tipping angle that liesbetween 90° and 180°, j is the number of echos observed and 2τ is aninterecho spacing. The basic sequence within the square bracket may berepeated i times with different wait times and the whole sequencedenoted by eq. (12) may be repeated at a single clamp position aplurality of times to improve the SNR. In the connecting and drillingmodes, the number of repetitions is less than in the clamped mode. Inthe tripping mode, it is usually not possible to repeat the basicsequence due to the high rate of axial movement of the tool.

As noted above, data are preferably acquired using the phase alternationof the 90° tipping pulse. This is necessary to avoid baseline errors.Apart from this, the downhole processor has the capability of adjustingany of the parameters in the pulse sequence given by eq. (12). As notedabove, in one embodiment of the invention, these changes are made by theoperator at the surface using a downlink capability. The effects ofchanges in the parameters are discussed next.

The simplest parameter that may be controlled is the number ofrepetitions i in eq. (12). The primary use of this is to improve the SNRand make use of the stacking capability discussed above. The selectionof this is determined primarily by the vibration of the tool and theaccompanying degradation of the echo signals. In the clamped mode, thismay be selected to be as large as necessary since there is no axial toolmotion. In the connect mode, even though there is no axial movement ofthe drillstring at the surface, due to the elasticity of thedrillstring, there may be axial movement of the NMR sensor assembly atdepth. Obviously, in the tripping mode, the number of repetitions can beincreased only at the cost of loss of resolution. In the drilling mode,the loss of resolution with a large choice of i depends upon the rate ofpenetration ROP: in hard limestones and dolomite rocks, the ROP is smalland hence more repetitions can be done, while in soft shales and softsandstones, the number of repetitions would be less.

Along with i, the wait time TW can also be changed. The effect ofchanging the wait time is to change the amount of polarization of thenuclear spins between successive CPMG sequences produced by the staticmagnetic field. In reservoirs including gas or light oil, long waittimes are required to fully polarize the hydrogen nuclei. This wouldappear to make it necessary to acquire data with long wait times toprovide an estimate of gas saturation. In the clamped mode, wait timesof several seconds are possible. However, estimates of gas saturationmay also be obtained using shorter wait times. This is discussed incopending U.S. patent application Ser. No. 09/396,286 of Thern et al,the contents of which are fully incorporated herein by reference. Thernteaches the use of a dual wait time data wherein the formation water issubstantially fully polarized at both wait times while the gas componentexperiences a different partial saturation for the two wait times. Themethod of Thern may be used at normal logging speeds and is hence alsosuitable for measurements in the drilling mode and in the connect mode.It may also be used with less effectiveness in the tripping mode.

At the other end of the relaxation time distribution, clay bound waterhas an extremely short relaxation time. There are a number of differentapproaches that may be taken to address this problem In on embodiment ofthe invention, a first plurality of short pulse sequences (small valuesof j) are acquired followed by a second plurality of longer pulsesequences (larger values of j) wherein the second plurality i is lessthan the first plurality i. This makes it possible to improve the SNRfor the early portion of the decay spectrum that needs it the most.Alternatively, a series of short pulse sequences are acquired with asmall value of τ followed by one or more regular (long) pulse sequenceswith a longer value of τ. The short pulse sequences with the small valueof τ make it possible to determine the CBW of the formation while thelong pulse sequence is used for obtaining the slowly relaxingcomponents. In an alternate embodiment of the invention, data areacquired with a variable τ within a single sequence as taught in anapplication entitled “NMR Data Acquisition with Multiple InterechoSpacing” filed under Ser. No. 10/191,153 on Jun. 28, 2001, the contentsof which are fully incorporated herein be reference.

Another acquisition parameter that can be controlled is the length andshape of the refocusing pulse. The Reiderman patent discusses theadvantage of shortening the tipping angle of the refocusing pulse forconserving power. In an alternate embodiment of the present invention,the shape of the refocusing pulse may also be changed. Co-pending U.S.patent application Ser. No. 09/606,998 of Beard et al, having the sameassignee as the present application and the contents of which are fullyincorporated herein by reference, discusses the effect of pulse shapingin a multi-frequency NMR tool for reducing the interference betweenpulse sequences at different RF frequencies. As discussed by Beard etal, the excitation and refocusing pulses need not be square waves in thetime domain. In the context of the present invention, the teachings ofBeard et al are also applicable in that the even for a single frequencytool, it is desirable to match the bandwidth of the 90° pulse with thebandwidth of the refocusing pulses.

Expert System for Control of Acquisition Parameters

Another novel feature of the present invention is the implementation ofan Expert Systemin the downhole processor for control of the acquisitionparameters. The use of the Expert System 401 is discussed with referenceto FIG. 5. There are three types of input data to the expert system.First, the Expert System adjusts the acquisition parameters from the NMR405 data alone. In the simplest example the Expert System may comparethe QC indicators, such as the sum of echos at different levels. Ifoutliers are detected, a warning signal is sent uphole.

The Expert System analyzes the acquired NMR data and from this, thepulse sequences may be shortened or lengthened (both i and j in eq.(12)) and the τ and TW may be adjusted as discussed above. This may bebased upon the determined porosity and T₂ spectrum characteristics suchas BVI, BVM (bound water movable), the geometric mean of the T₂distribution, the main peaks of the T₂ distribution.

The Expert System also has access to measurements made by other sensorsdescribed above with reference to FIG. 2. These may relate to drillingconditions or to the formation properties. An example of sensorsrelating to drilling conditions, i.e., the accelerometer measurements,has already been discussed above with respect to motion triggeredpulsing. If the downhole conditions are changing, the acquisition andprocessing parameters are changed accordingly.

In order to benefit from information relating to formation properties,it is preferable that the other formation evaluation sensors be locatedbetween the NMR sensors and the drillbit. With this configuration,measurements made by the other formation evaluation sensors 403 areanalyzed downhole and, based upon the rate of penetration, the ExpertSystem 401 knows the properties of the formation being drilled. The FPTgives an estimate of fluid mobility (defined as the ratio ofpermeability to viscosity). This, when combined with the NMR-determinedpermeability gives the fluid viscosity. FPT is also evaluating the fluidtype—information which can be used for NMR MWD again by the ExpertSystem to control the NMR acquisition by sending an appropriate signalto the NMR electronics 407, 129. If the preferred arrangement (otherformation evaluation sensors located between the NMR sensors and thedrill bit) is not used, then the Expert System changes the NMRacquisition parameters based upon predicted stratigraphy.

Specifically, gamma rays measurements may be used to determine the shalecontent of the formation at the depth of the NMR sensors. In a shalyinterval, short pulse sequences and small values of rare sufficient. Thepresence of hydrocarbons in the formation is diagnosed from resistivitymeasurements. The presence of gas in the formation may be indicated byacoustic log measurements. As would be known to those versed in the art,even a small amount of gas in the formation significantly lowers theP-wave velocity in a porous sand formation and additional changes inP-wave velocity changes are only slightly affected by the amount of gaspresent. In such a situation, it is desirable to use a dual wait timeacquisition and processing to determine the gas saturation.

Any changes made by the Expert System 401 in the acquisition andprocessing parameters are communicated uphole. The operator may thenreview these changes and, if necessary, override the decisions made bythe Expert System.

The Expert System 401 is preferably implemented using neural networks(NNs). In a preferred embodiment of the invention, more than one NN isused. A first NN is used for determination of lithology and formationfluid type from formation property measurements. A second NN is used formodifying the NMR acquisition and processing parameters based upon theknowledge of the lithology and fluid type and the drilling conditions.These are discussed separately.

The first NN that is used for lithology and fluid determination isdiscussed with reference to FIG. 6. The First NN 455 has as one of itsinput measurements from formation evaluation sensors 453. As notedabove, these can include resisitivity, acoustic, gamma ray, density andneutron sensors. Based upon these sensor outputs, the lithology andfluid content of the formation can be determined by a human 450. Thehuman's evaluation 451 of the lithology/fluid is compared 461 with theoutput of the NN. A NN implementation of the lithology/fluididentification involves changing the parameters 459 of the NN to providea match with the evaluation 451 made by a human expert.

The second NN that is used in the present invention has its inputs thelithology/fluid content of the formation and the output of drillingcondition sensors. These inputs are used to modify the NMR acquisitionparameters. Once again, the objective is to determine the parameters ofthis second NN that match those of a human expert.

As would be known to those versed in the art, there are three main stepsinvolved in using a NN. The first step is the training of the NN.Required for this is a wide statistical sampling of input parameters andthe corresponding decision of a human expert. The second step is thevalidation of the NN; in the validation process, samples that aredifferent from those used in the training process are input to the NNand the decision of the NN is again compared with that of the humanexpert. If there is agreement, then the NN has been validated. Once theNN has been validated, its structure and parameters may be stored in theprocessor and NN may then be used to process, preferably in real time,measurements made by the logging device. In a preferred embodiment ofthe invention, the Stuttgart Neural Net Simulator is used for thetraining of the NN.

While the foregoing disclosure is directed to the preferred embodimentsof the invention, various modifications will be apparent to thoseskilled in the art. It is intended that all variations within the scopeand spirit of the appended claims be embraced by the foregoingdisclosure.

1. An apparatus for drilling a borehole and determining a parameter ofinterest of a formation surrounding the borehole, said apparatuscomprising: (a) a longitudinal member for rotating a drill bit andadapted to be conveyed in the borehole; (b) formation evaluation sensoron said longitudinal member for making measurements indicative of atleast one of (A) a lithology of the formation, and, (B) a fluid contentof the formation; (c) an expert system for determining from saidmeasurements of the formation evaluation sensor at least one of (C) thelithology of the formation, and, (D) the fluid content of the formation.2. An apparatus for determining a parameter of interest of a formationsurrounding a borehole, said apparatus comprising: (a) a nuclearmagnetic resonance (NMR) sensor producing a pulsed RF field forobtaining first measurements indicative of the parameter of interest ofthe formation, the RF field characterized by a plurality of parameters;and (c) a processor including an expert system for controlling at leastone parameter of the pulsed RF field.
 3. The apparatus of claim 2wherein the processor is at a downhole location.
 4. The apparatus ofclaim 2 wherein the pulsed RF field comprises a pulse sequence of theform: [TW_(i) − 90_(±π/2) − (τ − X − τ − echo)_(j)]_(i) wherein TW is await time, 90_(±π/2) refers to a phase alternated 90° tipping pulse, Xis a refocusing pulse with a tipping angle that lies between 90° and180°, j is the number of echos observed, i is a number of repetitions,and 2τ is an interecho spacing, and wherein the parameter of interest ofthe pulsed RF field is selected from the group consisting of: (i) thetipping angle of the refocusing pulse, (ii) the number of echos j, (iii)the number of repetitions i, (iv) the interecho spacing, and (v) thewait time.
 5. The apparatus of claim 2 further comprising a telemetrymodule for communicating signals to and from a surface location.
 6. Theapparatus of claim 4 wherein the processor applies a stimulated echocorrection to the first measurements, the stimulated echo correctiondetermined by at least one of (i) a temperature of the formation, (ii)an intensity of the RF field, (iii) a bandwidth of the tipping pulse,and, (iv) a bandwidth of the refocusing pulse.
 7. The apparatus of claim2 further comprising a formation evaluation sensor for making secondmeasurements indicative of at least one of (i) a lithology of theformation, and, (ii) a fluid content of the formation.
 8. The apparatusof claim 7 wherein the expert system determines from the secondmeasurements at least one of (i) the lithology of the formation, (ii)the fluid content of the formation, and (iii) petrophysical properties.9. The apparatus of claim 2 further comprising a formation pressuretester (FPT) wherein the processor determines a fluid viscosity frommeasurements rustle byte FPT and NMR sensor.
 10. The apparatus of claim2 wherein the parameter of interest comprises at least one of (i) claybound water, (ii) gas saturation, (iii) porosity, (iv) bound volumeirreducible, (v) bound water movable, (vi) shale content, and (vii)presence of hydrocarbons.
 11. The apparatus of claim 2 furthercomprising an additional sensor selected from the group consisting of(i) a gamma ray sensor, (ii) a neutron sensor, (iii) a resistivitysensor, and, (iv) an acoustic sensor.
 12. The apparatus of claim 2wherein the processor provides a quality control (QC) diagnostic basedon at least one of (i) a signal from a motion sensor, (iii) a sum ofechos (SE) produced by the NMR sensor.
 13. The apparatus of claim 2wherein the first measurements further comprise two channels of data,the processor further determining a corrected measurement based on saidtwo channels.
 14. The apparatus of claim 2 wherein the processor appliesa calibration to the first measurements, said calibration based uponmeasurements made with the NMR sensor in a medium of known porosity. 15.The apparatus of claim 2 wherein the expert system comprises a neuralnet that has been trained and validated.
 16. A method of determining aparameter of interest of an earth formation comprising: (a) conveying alogging assembly into a borehole in the earth formation; (b) using anuclear magnetic resonance (NMR) sensor on the logging assembly andproducing a pulsed RF field for obtaining first measurements indicativeof the parameter of interest of the formation, the RF fieldcharacterized by a plurality of parameters; and (c) using a processorincluding an expert system for determining a lithology of the formationand selecting at least one parameter of the pulsed RF field based atleast in part on the determined lithology.
 17. The method of claim 16wherein the processor is at a downhole location.
 18. The method of claim16 the pulsed RF field a pulse sequence of the form:[TW_(i) − 90_(±π/2) − (τ − X − τ − echo)_(j)]_(i) wherein TW/is a waittime, 90_(±τ/2) refers to a phase alternated 90° tipping pulse, X is arefocusing pulse with a tipping angle that lies between 90° and 180°, jis the number of echos observed, i is a number of repetitions, and 2τ isan interecho spacing, snd wherein the parameter of interest of thepulsed RF field is selected from the group consisting of: (i) thetipping angle of the refocusing pulse, (ii) the number of echos j, (iii)the number of repetitions i (iv) the interecho spacing, and (v) the waittime.
 19. The method of claim 16 further comprising using a telemetrymodule on the BHA for communicating signals to and from a surfacelocation.
 20. The method of claim 18 further comprising using theprocessor for applying a stimulated echo correction to the firstmeasurements, the stimulated echo correction determined by at least oneof (i) a temperature of the formation, (ii) an intensity of the RFfield, (iii) a bandwidth of the tipping pulse, and, (iv) a bandwidth ofthe refocusing pulse.
 21. The method of claim 16 further comprisingusing a formation evaluation sensor for making second measurementsindicative of at least one of (i) a lithology of the formation, and,(ii) a fluid content of the formation.
 22. The method of claim 21further comprising using the expert system for determining from thesecond measurements at least one of (i) the lithology of the formation,(ii) the fluid content of the formation, and (iii) petrophysicalproperties of the formation.
 23. The method of claim 16 furthercomprising: (i) using a formation pressure tester (FPT) for providing ameasurement indicative of a mobility of a fluid in said formation, and(ii) using said downhole processor for determining a fluid viscosityfrom measurements made by the FPT and NMR sensor.
 24. The method ofclaim 16 wherein the parameter of interest comprises at least one of (i)clay bound water, (ii) gas saturation, (iii) porosity, (iv) bound volumeirreducible, (v) bound water movable, (vi) shale content and (vii)presence of hydrocarbons.
 25. The method of claim 16 further comprisingusing an additional sensor selected from the group consisting of (i) agamma ray sensor, (ii) a neutron sensor, (iii) a resistivity sensor,and, (iv) an acoustic sensor, for making a measurement indicative of aparameter of interest of said formation.
 26. The method of claim 16further comprising using the processor for providing a quality control(QC) diagnostic based on at least one of (i) a signal from a motionsensor, (iii) a sum of echos (SE) produced by the NMR sensor assembly.27. The method of claim 26 further comprising using the processor basedon said QC diagnostic for at least one of (i) discarding a subset of thefirst measurements, (ii) replacing a subset of the first measurementswith another subset of the first measurements, (iii) zeroing out partialecho trains.